<!-- eslint-disable vue/multi-word-component-names -->
<script setup>
import { onBeforeMount, reactive } from "vue";
import { getPromotionList } from "@/api/promotion";

let data = reactive({
  promotiom: [],
});

onBeforeMount(async () => {
  data.promotiom = await getPromotionList();
});

console.log(data);
</script>

<template>
  <el-card class="box-card" shadow="never">
    <slot name="header">
      <span>推广</span>
    </slot>
    <div class="promotion">
      <a v-for="item in data.promotiom" :key="item.id">
        {{ item.description }}
      </a>
    </div>
  </el-card>
</template>

<style scoped>
.promotion {
  display: flex;
  flex-direction: column;
}
</style>
